if ('serviceWorker' in navigator) {
  console.log('支持 Service Worker')
  navigator.serviceWorker
    .register('./service-worker.js', {
      scope: './'
    })
    .then(function (registration) {
      console.log('servcie worker 注册成功', registration)
    }).catch(function (err) {
    console.log('servcie worker 注册失败', err)
  })
}
